package com.jy.rhin.infra.cda.dao.impl;


import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jy.rhin.infra.cda.dao.GeRenJKXXDJDao;
import com.jy.rhin.infra.cda.gerenjbjkxx.*;
import com.jy.rhin.infra.cda.mapper.GeRenJKXXMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GeRenJKXXDJDaoImpl implements GeRenJKXXDJDao {

    @Autowired
    private GeRenJKXXMapper geRenJKXXMapper;

    @Override
    public GeRenJKDASYVo getGeRenJKDASY(String gerendabs, String yiliaojddm) {
        QueryWrapper<GeRenJKDASYVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yiliaojddm);
        query.last("limit 1");
        return geRenJKXXMapper.getGeRenJKDASY(query);
    }

    @Override
    public GeRenJBXXVo getGeRenJBXX(String gerendabs, String yiliaojddm) {
        QueryWrapper<GeRenJBXXVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yiliaojddm);
        query.last("limit 1");
        return geRenJKXXMapper.getGeRenJBXX(query);
    }

    @Override
    public List<GuoMinShiVo> getGuoMinJL(String empi) {
        QueryWrapper<GuoMinShiVo> query = new QueryWrapper<>();
        query.eq("patientId", empi);
        return geRenJKXXMapper.getGuoMinJL(query);
    }

    @Override
    public List<GeRenJWSVo> getJiWangShi(String gerendabs, String yiliaojddm) {
        QueryWrapper<GeRenJWSVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yiliaojddm);
        return geRenJKXXMapper.getJiWangShi(query);
    }

    @Override
    public List<GeRenSSSVo> getShouShuShi(String gerendabs, String yiliaojddm) {
        QueryWrapper<GeRenSSSVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yiliaojddm);
        return geRenJKXXMapper.getShouShuShi(query);
    }

    @Override
    public List<GeRenSXSVo> getShuXueShi(String gerendabs, String yiliaojddm) {
        QueryWrapper<GeRenSXSVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yiliaojddm);
        return geRenJKXXMapper.getShuXueShi(query);
    }

    @Override
    public List<GeRenWSSVo> getWaiShangShi(String gerendabs, String yiliaojddm) {
        QueryWrapper<GeRenWSSVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yiliaojddm);
        return geRenJKXXMapper.getWaiShangShi(query);
    }

    @Override
    public List<GeRenYCSVo> getYiChuangShi(String gerendabs, String yiliaojddm) {
        QueryWrapper<GeRenYCSVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yiliaojddm);
        return geRenJKXXMapper.getYiChuangShi(query);
    }

    @Override
    public List<GeRenJZSVo> getJiaZuS(String gerendabs, String yewujgdm) {
        QueryWrapper<GeRenJZSVo> query = new QueryWrapper<>();
        query.eq("GERENDABS", gerendabs);
        query.eq("YEWUJGDM", yewujgdm);
        return geRenJKXXMapper.getJiaZuShi(query);
    }
}
